package 第三周;

/*
 * @author  YxinMiracle
 * @date  2022-04-27 9:20
 * @Gitee: https://gitee.com/yxinmiracle
 */

public class pow {
    public double myPow(double x, int n) {
        if (n == 0) return 1;
        if (n == Integer.MIN_VALUE) return 1.0 / myPow(x,-(n+1)) * x;
        if (n < 0) return 1.0 / myPow(x, -n);
        // 分治思想
        double temp = myPow(x, n/2);
        double ans = temp * temp;
        if (n % 2 == 1) ans *= x;
        return ans;
    }

    public static void main(String[] args) {
//        System.out.println(new pow().myPow(2, 2));
        int i = 0 % 2;
        System.out.println(i);
    }
}
